A Verification-Based Approach to Memory Fence Insertion in PSO Memory Systems
نویسندگان
چکیده
This paper addresses the problem of verifying and correcting programs when they are moved from a sequential consistency execution environment to a relaxed memory context. Specifically, it considers the PSO (Partial Store Order) memory model, which corresponds to the use of a store buffer for each shared variable and each process. We also will consider, as an intermediate step, the TSO (Total Store Order) memory model, which corresponds to the use of one store buffer per process. The proposed approach extends a previously developed verification tool that uses finite automata to symbolically represent the possible contents of the store buffers. Its starting point is a program that is correct for the usual Sequential Consistency (SC) memory model, but that might be incorrect under PSO with respect to safety properties. This program is then first analyzed and corrected for the TSO memory model, and then this TSO-safe program is analyzed and corrected under PSO, producing a PSO-safe program. To obtain a TSO-safe program, only store-load fences (TSO only allows store-load relaxations) are introduced into the program. Finaly, to produce a PSO-safe program, only store-store fences (PSO additionally allows store-store relaxations) are introduced. An advantage of our technique is that the underlying symbolic verification tool makes a full exploration of program behaviors possible even for cyclic programs, which makes our approach broadly applicable. The method has been tested with an experimental implementation and can effectively handle a series of classical examples.
منابع مشابه
Memorax, a Precise and Sound Tool for Automatic Fence Insertion under TSO
We introduce MEMORAX, a tool for the verification of control state reachability (i.e., safety properties) of concurrent programs manipulating finite range and integer variables and running on top of weak memory models. The verification task is non-trivial as it involves exploring state spaces of arbitrary or even infinite sizes. Even for programs that only manipulate finite range variables, the...
متن کاملPrecise and Sound Automatic Fence Insertion Procedure under PSO
We give a sound and complete procedure for fence insertion for concurrent finite-state programs running under the PSO memory model. This model allows “write to read” and “write-to-write” relaxations corresponding to the addition of an unbounded store buffers between processors and the main memory. We introduce a novel machine model, called the Hierarchical Single-Buffer (HSB) semantics, and sho...
متن کاملA Verification-Based Approach to Memory Fence Insertion in Relaxed Memory Systems
This paper addresses the problem of verifying and correcting programs when they are moved from a sequential consistency execution environment to a relaxed memory context. Specifically, it considers the TSO (Total Store Order) relaxation, which corresponds to the use of store buffers, and its extension x86-TSO, which in addition allows synchronization and lock operations. The proposed approach u...
متن کاملVerification of Software under Relaxed Memory
Leonardsson, C. 2016. Verification of Software under Relaxed Memory. Digital Comprehensive Summaries of Uppsala Dissertations from the Faculty of Science and Technology 1387. 102 pp. Uppsala: Acta Universitatis Upsaliensis. ISBN 978-91-554-9616-6. The work covered in this thesis concerns automatic analysis of correctness of parallel programs running under relaxed memory models. When a parallel ...
متن کاملSeparating Computation from Communication: A Design Approach for Concurrent Program Verification
We describe an approach to design static analysis and verification tools for concurrent programs that separates intra-thread computation from interthread communication by means of a shared memory abstraction (SMA). We formally characterize the concept of thread-asynchronous transition systems that underpins our approach and that allows us to design tools as two independent components, the intra...
متن کامل